LrmPackageReader.GetFileStream Method

Returns a System.IO.Stream for the file inside the LRM package referenced by filePath.

Parent Type: LrmPackageReader

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public override Stream GetFileStream (
string filePath

)

Parameters

filePath

The file to retrieve. The path is relative to the root of the file hierarchy in the LRM package. If this path indicates a file that is not in the LRM package, a System.IO.FileNotFoundException is thrown.

Return Value

System.IO.Stream for the specified file.

Exceptions
Exception type Condition
IOException

The file is already open.

ArgumentException

filePath contains invalid characters.

ArgumentNullException

filePath is null.

InvalidOperationException

The LrmPackageReader is in an error state.

FileNotFoundException

The file specified was not found.

Permissions
Name Description
System.Security.Permissions.FileIOPermission

for creating directories and reading and writing files. Associated enumerations: System.Security.Permissions.FileIOPermissionAccess.Read and System.Security.Permissions.FileIOPermissionAccess.Write.

Remarks

filePath is a relative path to the root of the LRM package.

The LRM package will be exploded into a temporary directory when this method is called, if not done previously.